<template>
    <div class="son1">
        <h3>SonDemo1</h3>
        <h3>props 的传值</h3>
        <h3>标题：{{ props.title }}</h3>
        <p>描述：{{ props.description }}</p>
    </div>
</template>

<script setup lang='ts'>
// props传值
// const props = defineProps(['title', 'description'])

// Props传值检查类型和设置必传
const props = defineProps({
    title: [String, Number],
    description: {
        type: [String, Number],
        required: true, // description 这个属性必写
    }
})

</script>

<style lang="scss" scoped>
.son1 {
    border: 3px solid deeppink;
    margin: 10px;
    padding: 10px;
}
</style>